﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Tabs.aspx.cs" Inherits="WebAvalon.View.Tabs" %>

<!DOCTYPE html>
<html>
<head>
    <title>TODO supply a title</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">
    <script src="../Scripts/dist/avalon.js"></script>

    <style>
        button {
            margin: 1em 3em;
        }

        .panel div {
            height: 200px;
            background: #a9ea00;
        }

        .panel p {
            height: 200px;
            background: green;
        }

        .panel strong {
            display: block;
            width: 100%;
            height: 200px;
            background: #999;
        }
    </style>
</head>
<body>
    <div ms-controller="test">
        <div>
            <button ms-for='(i, el) in @buttons' ms-click='@curIndex = i'>{{el}}</button></div>
        <div class='panel' ms-for='(jj, el) in @panels' ms-visible='jj == @curIndex' ms-html='el'></div>
    </div>
</body>
<script>
    var vm = avalon.define({
        $id: "test",
        curIndex: 0, //默认显示第一个
        buttons: ['aaa', 'bbb', 'ccc'],
        panels: ['<div>面板1</div>', '<p>面板2</p>', '<strong>面板3</strong>']
    })

</script>
</html>
